﻿using IceDog.Uop.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IceDog.Uop.Models.Context
{
    public class DbInitializer
    {
        public static void Initialize(UopContext context)
        {
            if (context.Users.Any())
            {
                return;
            }
            var users = new User[]
            {
                new User()
                {
                    
                    Name="李毅",
                    Age=24,
                    Gender=Gender.Man,
                    Birthday=new DateTime(1994,9,12),
                    Address="中国，重庆市，江北区，白花镇",
                    IsDeleted=false,
                    MobilePhone="13371210150",
                    Remark="重庆大客户"
                },
                new User()
                {

                    Name="李万",
                    Age=24,
                    Gender=Gender.Man,
                    Birthday=new DateTime(1994,5,26),
                    Address="中国，北京市，朝阳区，白花镇",
                    IsDeleted=false,
                    MobilePhone="13371210132"
                },
                new User()
                {

                    Name="赵婉清",
                    Age=24,
                    Gender=Gender.Woman,
                    Birthday=new DateTime(1994,2,12),
                    Address="中国，北京市，朝阳区，白花镇",
                    IsDeleted=false,
                    MobilePhone="13371210134"
                },
                new User()
                {

                    Name="李彦宏",
                    Age=24,
                    Gender=Gender.Man,
                    Birthday=new DateTime(1994,7,18),
                    Address="中国，北京市，朝阳区，白花镇",
                    IsDeleted=false,
                    MobilePhone="13371210144"
                },
                new User()
                {

                    Name="王晓蓉",
                    Age=24,
                    Gender=Gender.Woman,
                    Birthday=new DateTime(1994,11,8),
                    Address="中国，北京市，朝阳区，白花镇",
                    IsDeleted=false,
                    MobilePhone="13371211134"
                },new User()
                {

                    Name="李丹",
                    Age=24,
                    Gender=Gender.Woman,
                    Birthday=new DateTime(1994,9,5),
                    Address="中国，重庆市，江北区，白花镇",
                    IsDeleted=false,
                    MobilePhone="13371220150",
                    Remark="重庆大客户"
                },
                new User()
                {

                    Name="王丽",
                    Age=24,
                    Gender=Gender.Man,
                    Birthday=new DateTime(1994,6,8),
                    Address="中国，北京市，昌平区，白花镇",
                    IsDeleted=false,
                    MobilePhone="13371210134"
                },
                new User()
                {

                    Name="夏天",
                    Age=24,
                    Gender=Gender.Woman,
                    Birthday=new DateTime(1994,1,8),
                    Address="中国，北京市，朝阳区，白花镇",
                    IsDeleted=false,
                    MobilePhone="13371210164"
                },
                new User()
                {

                    Name="赵方清",
                    Age=24,
                    Gender=Gender.Man,
                    Birthday=new DateTime(1994,6,14),
                    Address="中国，北京市，朝阳区，白花镇",
                    IsDeleted=false,
                    MobilePhone="13371210194"
                },
                new User()
                {

                    Name="周晓晓",
                    Age=24,
                    Gender=Gender.Woman,
                    Birthday=new DateTime(1994,5,8),
                    Address="中国，重庆市，南岸区，白花镇",
                    IsDeleted=false,
                    MobilePhone="13371611134"
                }
            };
            foreach (var user in users)
            {
                context.Users.Add(user);
            }
            context.SaveChanges();
        }
    }
}
